<!-- 组件的模板 -->
<template>
  <div class="week">
		<week-header></week-header>
		<week-content :weekInfo="weekInfo"></week-content>
  </div>
</template>

<!-- 组件中的数据 -->
<script>
	import {getWeek} from '@/api'
	import WeekHeader from 'weekbase/Header'
	import WeekContent from 'weekbase/Content'
	
export default {
	name: "Week",
	data() {
		return {
			id: localStorage.getItem("weekId") || "0001",
			weekInfo: []
		}
	},
	created() {
		let {id} = this.$route.params
		localStorage.setItem("weekId",id)
		this.$nextTick(function(){
			getWeek(this.id).then( res=>{
				let {weekInfo} = res;
				this.weekInfo = weekInfo
			})
		})
	},
	components:{
		WeekContent,
		WeekHeader
	}
}
</script>

<!-- 组件模板的css -->
<style lang='stylus' scoped>

</style>
